package com.yc.cloud.admin.dto.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 添加人脸文件响应DTO
 *
 * @author JackGu
 * @since 2025-11-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加人脸文件响应DTO")
public class FaceAddFileRespDTO extends BaseFaceResponse<FaceAddFileRespDTO.FaceData> {

    /**
     * 人脸数据
     */
    @Data
    @ApiModel(value = "人脸数据")
    public static class FaceData {
        @ApiModelProperty(value = "人脸ID")
        private String faceId;

        @ApiModelProperty(value = "人员ID")
        private String personId;

        @ApiModelProperty(value = "人员姓名")
        private String personName;

        @ApiModelProperty(value = "人脸质量分数（0-1）")
        private Double quality;

        @ApiModelProperty(value = "人脸位置")
        private FaceRect faceRect;
    }

    /**
     * 人脸位置信息
     */
    @Data
    @ApiModel(value = "人脸位置")
    public static class FaceRect {
        @ApiModelProperty(value = "X坐标")
        private Integer x;

        @ApiModelProperty(value = "Y坐标")
        private Integer y;

        @ApiModelProperty(value = "宽度")
        private Integer width;

        @ApiModelProperty(value = "高度")
        private Integer height;
    }

    /**
     * 获取人脸ID（便捷方法）
     */
    public String getFaceId() {
        return getData() != null ? getData().getFaceId() : null;
    }
}

